import http from "@/utils/http.js";

/**
 * addAddress
 * @param {object} params AddressRequest
 * @param {string} params.receiver
 * @param {string} params.contact
 * @param {string} params.provinceCode
 * @param {string} params.cityCode
 * @param {string} params.districtCode
 * @param {string} params.detailAddress
 * @param {string} params.fullAddress
 * @param {string} params.postcode
 * @param {string} params.addressTag
 * @param {number} params.isDefault
 * @returns
 */
export function addAddressAPI(params) {
    return http.post(`/address/add`, params);
}


/**
 * getAddress
 * @returns
 */
export function getAddressAPI() {
    return http.get(`/address/get`);
}

/**
 * changeDefaultAddress
 * @param {object} params IdRequest
 * @param {number} params.id
 * @returns
 */
export function changeDefaultAddressAPI(params) {
    return http.put(`/address/changeDefault`, params);
}

/**
 * deleteAddress
 * @param {object} params IdRequest
 * @param {number} params.id
 * @returns
 */
export function deleteAddressAPI(params) {
    return http.post(`/address/delete`, params);
}